On the c-bindings side the marshalling code converts the string representation to an enum value. A subsequent attempt to convert the enum from a string to an enum was causing a seg fault.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
xen_enum_lookup_(session__, str__, lookup_table__, \
sizeof(lookup_table__) / \
sizeof(lookup_table__[0])) \
- \
#define XEN_ALLOC(type__) \
type__ * \
};
abstract_type result_type = xen_vm_power_state_abstract_type_;
- char *result_str = NULL;
XEN_CALL_("VM.get_power_state");
- *result = xen_vm_power_state_from_string(session, result_str);
return session->ok;
}
# attributes (ro)
def VM_get_power_state(self, session, vm_ref):
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
- return xen_api_success(dom.state)
+ return xen_api_success(dom.get_power_state())
def VM_get_resident_on(self, session, vm_ref):
return xen_api_success(XendNode.instance().uuid)